package com.xbongbong.pro.performance.pojo.dto;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @description: 保存业绩目标
 * @Author: hongxiao
 * @date: 2019-02-18 11:24
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class PerformanceSaveWebDTO extends BaseDTO {
    /**
     * 指标id
     */
    @NotNull(message = "{dto.msg.performanceSaveApp.setId.NotNull}")
    private Long setId;
    /**
     * 业绩类型：1员工的业绩 2部门的业绩
     */
    @NotNull(message = "{dto.msg.performanceSaveApp.companyStructType.NotNull}")
    @Min(value = 1, message = "{dto.msg.performanceSaveApp.companyStructType.Max}")
    @Max(value = 2, message = "{dto.msg.performanceSaveApp.companyStructType.Max}")
    private Integer companyStructType;
    /**
     * 员工Id数组（当ocompanyStructType=1，该值必填）
     */
    private List<String> userIdIn;
    /**
     * 部门Id数组（当companyStructType=2，该值必填）
     */
    private List<Long> depIdIn;
    /**
     * 筛选的财年年份
     */
    @NotNull(message = "{dto.msg.performanceSaveApp.year.NotNull}")
    private Integer year;
    /**
     * 当指标最小考核周期为“周”时，该值必传
     */
    private Integer month;
    /**
     * 指标值
     */
    @NotNull(message = "{dto.msg.performanceSaveApp.target.NotNull}")
    private JSONObject target;
    /**
     * 指标类型：1系统指标,2自定义指标
     */
    @NotNull(message = "指标类型不能为空")
    @Range(min=1,max=2,message = "指标类型传值异常")
    protected Integer statisticsType;
}
